package com.tansen.springcould.service.impl;

import com.tansen.springcould.api.entities.Dept;
import com.tansen.springcould.dao.DeptDao;
import com.tansen.springcould.service.DeptService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {
    private Logger logger = LoggerFactory.getLogger(DeptServiceImpl.class);
    @Autowired
    private DeptDao deptDao;

    @Override
    public boolean add(Dept dept) {
        logger.info("rest请求===>",dept);
        return deptDao.addDept(dept);
    }

    @Override
    public Dept get(Long id) {
        return deptDao.findById(id);
    }

    @Override
    public List<Dept> list() {
        return deptDao.findAll();
    }

}
 

